/*

Copyright 2007 Renaun Erickson (http://renaun.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ignore
*/
package asfslib.api.familytree.v1
{
/**
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="eventSummary">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="place" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *       &lt;attribute name="scope" type="{http://api.familysearch.org/familytree/v1}scope" />
 *       &lt;attribute name="type" type="{http://api.familysearch.org/familytree/v1}eventType" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
public class EventSummary 
{

    //--------------------------------------------------------------------------
    //
    //  Constants
    //
    //--------------------------------------------------------------------------
    
    public static function parseXML(xml:XML):EventSummary
    {
    	if (xml.namespace("") != undefined) 
		{
		    default xml namespace = xml.namespace("");
		} 
		
		var event:EventSummary = new EventSummary();
		event.date = xml.date;
		event.type = xml.@type;
		try 
		{
			event.scope = new Scope(xml.@scope);	
		}
		catch(error:Error)
		{
			// Invalid scope value	
		}		
		event.place = xml.place;
		
		default xml namespace = new Namespace("");
		
    	return event;
    }
    
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------    

    //----------------------------------
    //  date
    //----------------------------------

    /**
     *  @private
     *  Storage for the date property.
     */
    private var _date:String = "";

    /**
     *  The date property
     *
     *  @default  = ""
     */
    public function get date():String
    {
        return _date;
    }

    /**
     *  @private
     */
    public function set date(value:String):void
    {
        _date = value;
    }


    //----------------------------------
    //  place
    //----------------------------------

    /**
     *  @private
     *  Storage for the place property.
     */
    private var _place:String = "";

    /**
     *  The place property
     *
     *  @default  = ""
     */
    public function get place():String
    {
        return _place;
    }

    /**
     *  @private
     */
    public function set place(value:String):void
    {
        _place = value;
    }


    //----------------------------------
    //  scope
    //----------------------------------

    /**
     *  @private
     *  Storage for the scope property.
     */
    private var _scope:Scope;

    /**
     *  The scope property
     *
     *  @default 
     */
    public function get scope():Scope
    {
        return _scope;
    }

    /**
     *  @private
     */
    public function set scope(value:Scope):void
    {
        _scope = value;
    }


    //----------------------------------
    //  type
    //----------------------------------

    /**
     *  @private
     *  Storage for the type property.
     */
    private var _type:String = "";

    /**
     *  The type property
     *
     *  @default  = ""
     */
    public function get type():String
    {
        return _type;
    }

    /**
     *  @private
     */
    public function set type(value:String):void
    {
        _type = value;
    }


    //--------------------------------------------------------------------------
    //
    //  Methods
    //
    //--------------------------------------------------------------------------



}
}
